<template>
  <div>
    <Modal v-model="modal1" title="创建优惠劵">
      <Form ref="form1" :model="form1" :rules="rules1" :label-width="80">
        <Row class="pr">
          <div class="select-input-row">
            <div>
              <FormItem label="返劵面额" prop="denomination">
                <Select v-model="form1.denomination" style="width:200px">
                  <Option
                    v-for="item in form1.list"
                    :value="item.value"
                    :key="item.value"
                  >{{ item.label }}</Option>
                </Select> 元
              </FormItem>
            </div>
            <div v-if="form1.denomination == 'custom'">
              <FormItem prop="custom" class="item-left">
                <InputNumber v-model.trim="form1.custom" style="width:100px" :maxlength="5" placeholder="自定义金额"></InputNumber>
              </FormItem>
            </div>
          </div>
        </Row>
        <FormItem label="使用条件" prop="useCondition">
          <Input v-model="form1.useCondition" style="width:200px" :maxlength="5" placeholder="请输入使用条件"/> 元使用
        </FormItem>
        <FormItem label="有效期" prop="validityDays">
          <InputNumber v-model="form1.validityDays" :min="0"></InputNumber> 天
        </FormItem>
      </Form>
      <div slot="footer">
        <Button type="text" size="large" @click="cancel1">取消</Button>
        <Button type="primary" size="large" @click="ok1">确定</Button>
      </div>
    </Modal>
  </div>
</template>
<script>
export default {
  name: "addDiscound",
  props: {
    form1: "",
    rules1: ""
  },
  data() {
    return {
      modal1: false
    };
  },
  methods: {
    ok1() {
      this.$emit("onOk");
    },
    cancel1() {
      this.$emit("onCancel");
    }
  }
};
</script>

